#class and object 物件函式 VS 一般函式
#物件函式的第一個參數為reference物件本身"SELF"
class Personality:
def __init__(self,bloodtype,sexual,pets,is_graduated):
self.bloodtype = bloodtype
self.sexual = sexual
self.pets = pets
self.is_graduated = is_graduated
def check_graduated_status(self):
return self.is_graduated
person1 = Personality("A","Female",2,True)
print (person1.sexual,person1.check_graduated_status())
person2 = Personality("O","Male",33,False)
print (person2.pets)